import request from '@/utils/request'
import MODULE from '@/utils/module'
export function getList(data, currentPage, pageSize) {
    return request({
        url: MODULE.MODULE.employee + '/Employee/list?pageSize=' + pageSize + '&pageNum=' + currentPage,
        method: 'post',
        params: {},
        data: data,
        transformRequest: [function(data) { // 在请求之前对data传参进行格式转换
            data = JSON.stringify(data)
            return data
        }],
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function doDelete(id) {
    return request({
        url: MODULE.MODULE.employee + '/Employee/remove/'+id,
        method: 'delete',
        params: {  }
    })
}

// 编辑
export function doEdit(data) {
    return request({
        url: MODULE.MODULE.employee + '/Employee/edit',
        method: 'PATCH',
        params: {},
        data: data,
        transformRequest: [function(data) { // 在请求之前对data传参进行格式转换
                data = JSON.stringify(data)
                return data
            }],
        headers: {
        'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}
